package com.lirh.queue.rabbitmqproduct.service;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Log4j2
@Component
public class PaymentNotifySender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sender(String msg){
        rabbitTemplate.convertAndSend("notify.payment",msg);
    }

    public void generateReports(String msg){
        log.info(msg);
        rabbitTemplate.convertAndSend("reportExchange","api.generate.reports",msg);
    }
}
